package com.chuangsi.project.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 系统对外请求表
* </p>
*
* @author ywb
* @since 2024-07-26
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="SysOutRequest对象", description="系统对外请求表")
    public class SysOutRequest extends Model<SysOutRequest> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message="主键不能为空")
    private Long id;

    @ApiModelProperty(value = "表id")
    @NotBlank(message="表id不能为空")
    private String sourceId;

    @ApiModelProperty(value = "表名")
    @NotNull(message="表名不能为空")
    private String sourceTable;

    @ApiModelProperty(value = "请求路径")
    @NotBlank(message="请求路径不能为空")
    private String path;

    @ApiModelProperty(value = "请求参数")
    private String params;

    @ApiModelProperty(value = "返回状态（0：成功 1：失败）")
    @NotNull(message="返回状态（0：成功 1：失败）不能为空")
    private Integer status;

    @ApiModelProperty(value = "返回描述")
    private String result;

    @ApiModelProperty(value = "返回数据")
    private String data;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
